#include "BulletCollision/CollisionShapes/btOptimizedBvh.h"
#ifdef __cplusplus
extern "C" {
#endif
btOptimizedBvh* bullet_NewbtOptimizedBvh(){
	btOptimizedBvh* wrap_out = new btOptimizedBvh();
	return wrap_out;
}

void bullet_btOptimizedBvh_build(btOptimizedBvh* c_this,btStridingMeshInterface* triangles,bool useQuantizedAabbCompression,btVector3* bvhAabbMin,btVector3* bvhAabbMax){
	btStridingMeshInterface * c_arg_triangles=(btStridingMeshInterface *)(void*)(triangles);
	bool c_arg_useQuantizedAabbCompression=useQuantizedAabbCompression;
	btVector3 const& c_arg_bvhAabbMin=(btVector3 const&)(*bvhAabbMin);
	btVector3 const& c_arg_bvhAabbMax=(btVector3 const&)(*bvhAabbMax);
	c_this->build(c_arg_triangles,c_arg_useQuantizedAabbCompression,c_arg_bvhAabbMin,c_arg_bvhAabbMax);
}

btOptimizedBvh* bullet_btOptimizedBvh_deSerializeInPlace(btOptimizedBvh* c_this,void* i_alignedDataBuffer,unsigned int i_dataBufferSize,bool i_swapEndian){
	void * c_arg_i_alignedDataBuffer=(void *)(void*)(i_alignedDataBuffer);
	unsigned int c_arg_i_dataBufferSize=i_dataBufferSize;
	bool c_arg_i_swapEndian=i_swapEndian;
	btOptimizedBvh * c_out = c_this->deSerializeInPlace(c_arg_i_alignedDataBuffer,c_arg_i_dataBufferSize,c_arg_i_swapEndian);
	btOptimizedBvh* wrap_out = (btOptimizedBvh*)(void*)(c_out);
	return wrap_out;
}

void bullet_btOptimizedBvh_refit(btOptimizedBvh* c_this,btStridingMeshInterface* triangles,btVector3* aabbMin,btVector3* aabbMax){
	btStridingMeshInterface * c_arg_triangles=(btStridingMeshInterface *)(void*)(triangles);
	btVector3 const& c_arg_aabbMin=(btVector3 const&)(*aabbMin);
	btVector3 const& c_arg_aabbMax=(btVector3 const&)(*aabbMax);
	c_this->refit(c_arg_triangles,c_arg_aabbMin,c_arg_aabbMax);
}

void bullet_btOptimizedBvh_refitPartial(btOptimizedBvh* c_this,btStridingMeshInterface* triangles,btVector3* aabbMin,btVector3* aabbMax){
	btStridingMeshInterface * c_arg_triangles=(btStridingMeshInterface *)(void*)(triangles);
	btVector3 const& c_arg_aabbMin=(btVector3 const&)(*aabbMin);
	btVector3 const& c_arg_aabbMax=(btVector3 const&)(*aabbMax);
	c_this->refitPartial(c_arg_triangles,c_arg_aabbMin,c_arg_aabbMax);
}

void bullet_btOptimizedBvh_updateBvhNodes(btOptimizedBvh* c_this,btStridingMeshInterface* meshInterface,int firstNode,int endNode,int index){
	btStridingMeshInterface * c_arg_meshInterface=(btStridingMeshInterface *)(void*)(meshInterface);
	int c_arg_firstNode=firstNode;
	int c_arg_endNode=endNode;
	int c_arg_index=index;
	c_this->updateBvhNodes(c_arg_meshInterface,c_arg_firstNode,c_arg_endNode,c_arg_index);
}

#ifdef __cplusplus
}
#endif
